function columns(vm) {
  const cols = [
    {
      title: '序号',
      dataIndex: '',
      key: 'rowIndex',
      width: 60,
      align: 'center',
      customRender: function (t, r, index) {
        return parseInt(index) + 1
      }
    },
    {
      title: '英文名称',
      align: 'center',
      dataIndex: 'fieldNameEN',
      key: 'fieldNameEN',
    },
    {
      title: '中文名称',
      align: 'center',
      dataIndex: 'fieldNameZH',
      key: 'fieldNameZH'
    },
    {
      title: '数据类型',
      align: 'center',
      dataIndex: 'fieldType',
      key: 'fieldType'
    },
    {
      title: '值域',
      align: 'center',
      dataIndex: 'fieldLength',
      key: 'fieldLength'
    },
    {
      title: '约束/条件',
      align: 'center',
      dataIndex: 'fieldIsNull',
      key: 'fieldIsNull',
      customRender: (t, r, i) => {
        return t == '0' ? 'M必选' : 'O可选'
      }
    },
    {
      title: '字段约束',
      align: 'center',
      dataIndex: 'fieldConstraint',
      key: 'fieldConstraint',
      customRender: (t, r, i) => {
        let cases = {
          '0': '普通',
          '1': '主键'
        }
        return cases[t]
      }
    },
    {
      dataIndex: 'action',
      align: 'center',
      slots: { title: 'actionName' },
      scopedSlots: { customRender: 'action' }
    }
  ]
  return cols
}

export default columns